#ifndef _WX_GTK_CONTROL_H_
#define _WX_GTK_CONTROL_H_

typedef struct _GtkLabel GtkLabel;
typedef struct _GtkFrame GtkFrame;

extern "C" {
  typedef GtkWidget* ( *wxGtkWidgetNew_t )( void );
  typedef GtkWidget* ( *wxGtkWidgetNewFromStr_t )( const gchar* );
  typedef GtkWidget* ( *wxGtkWidgetNewFromAdj_t )( GtkAdjustment* );
}

class wxControl : public wxControlBase {
  public:
    wxControl();
    wxControl( wxWindow *parent, wxWindowID id,const wxPoint& pos = wxDefaultPosition,
               const wxSize& size = wxDefaultSize, long style = 0,const wxValidator& validator = wxDefaultValidator,
               const wxString& name = wxControlNameStr ) {
      Create( parent, id, pos, size, style, validator, name );
    }

    bool Create( wxWindow *parent, wxWindowID id,const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize, long style = 0,const wxValidator& validator = wxDefaultValidator,
                 const wxString& name = wxControlNameStr );

    virtual void SetLabel( const wxString &label );
    virtual wxString GetLabel() const;
    virtual wxVisualAttributes GetDefaultAttributes() const;
    virtual void OnInternalIdle();
  protected:
    virtual wxSize DoGetBestSize() const;
    void PostCreation( const wxSize& size );
    void GTKSetLabelForLabel( GtkLabel *w, const wxString& label );
    GtkWidget* GTKCreateFrame( const wxString& label );
    void GTKSetLabelForFrame( GtkFrame *w, const wxString& label );
    void GTKFrameApplyWidgetStyle( GtkFrame* w, GtkRcStyle* rc );
    void GTKFrameSetMnemonicWidget( GtkFrame* w, GtkWidget* widget );
    static wxString GTKRemoveMnemonics( const wxString& label );
    static wxString GTKConvertMnemonics( const wxString &label );
    static wxVisualAttributes
    GetDefaultAttributesFromGTKWidget( GtkWidget* widget,bool useBase = false,int state = -1 );
    static wxVisualAttributes
    GetDefaultAttributesFromGTKWidget( wxGtkWidgetNew_t,bool useBase = false,int state = -1 );
    static wxVisualAttributes
    GetDefaultAttributesFromGTKWidget( wxGtkWidgetNewFromStr_t,bool useBase = false,int state = -1 );
    static wxVisualAttributes
    GetDefaultAttributesFromGTKWidget( wxGtkWidgetNewFromAdj_t,bool useBase = false,int state = -1 );
    virtual bool UseGTKStyleBase() const { return false; }
    wxString m_label;
  private:
    DECLARE_DYNAMIC_CLASS( wxControl )
};

void wxGtkFixSensitivity( wxWindow* ctrl );

#endif
